import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *
testCase="DBshop006_商品管理搜索商品流程"
firefox=openBrowser(urlAdmin) #调用函数打开网址
DBshopLoginAdmin(firefox)
DBshopEnterMenu2(firefox,'商品管理','管理商品')
firefox.find_element_by_name('goods_name').send_keys('美的')
firefox.find_element_by_xpath('//button').click()
time.sleep(3)
s=firefox.find_element_by_xpath('//body').text
l='商品数：'
r='\)'
num=reGetString(s,l,r)
if num=="1":#1是预期值
    writeLog("%s 测试通过" % testCase)
else:
    writeLog("%s 测试不通过" % testCase)
    getPhoto(firefox)
firefox.quit()